//PRACTICA PROPIA


var myStr = ("Sergi");
var myNum = (800);
console.log("Hello Mr. %s your current %s credit is %n", myStr,"poor", myNum);

function Person(arq_name, arq_age){
    this.name = arq_name;
    this.age = arq_age;
    
}

var sergi = new Person ("sergi", 27)

console.log("Hello, my name is %s and I am %n years old", sergi.name, sergi.age);


//PRACTICA DEL JOSE


function BankAccount(arg_firstName, arg_lastName, arg_initialAmount) {
    
    this.name = arg_firstName + " " + arg_lastName;
    this.currentBalance = arg_initialAmount;
    this.id = Math.floor(Math.random()*11);
    
    console.debug("Thank you Mr. %s, your account number %n was created with an initial balance of %n euros. \nHave a nice day", this.name, this.id, arg_initialAmount);
    
    this.withdraw = function(arg_withdrawAmount){
    
    this.currentBalance = this.currentBalance - arg_withdrawAmount;  
    console.debug("Now you are %n more poor, bitch", arg_withdrawAmount);
    };

    this.deposit = function(arg_depositAmount){
    
    this.currentBalance = this.currentBalance + arg_depositAmount;  
    console.log("Mr. %s, now you are %n richer,so your total balance is %n ", this.name, arg_depositAmount, this.currentBalance);
    
    };
    
    this.balance = function(){  
    console.log("Mr. %s, your total credit is %n", this.name, this.currentBalance );
    
    };
    
}
    
var Sergi = new BankAccount ("Sergi", "Gómez",300);

var Jose = new BankAccount ("Jose", "Badeau", 1000);


Jose.currentBalance = 0;
console.log("Jose is now poor, total credit %n", Jose.currentBalance);

Jose.withdraw(5000);
Sergi.deposit(100000);

Sergi.balance();
Jose.balance();





function Animal(arg_name, arg_family, arg_specie, arg_legs){
    
    var name = arg_name;
    
    var family = arg_family;
    
    var specie = arg_specie;
    
    var legs = arg_legs;
    
    console.log("The %s is a %s animal, from the %s specie, and it has %n legs", name, family, specie, legs)
}

var dog = new Animal ("dog", "mammal", "canis lupus", 4);